package com.leetcode.LC;

public class LC1725 {
    public int countGoodRectangles(int[][] rectangles) {
        int max = 0, num = 0;
        for (int[] rectangle : rectangles) {
            int min = Math.min(rectangle[0], rectangle[1]);
            if (min > max) {
                max = min;
                num=1;
            } else if (min == max) {
                num++;
            }
        }
        return num;
    }

    public static void main(String[] args) {
        System.out.println(new LC1725().countGoodRectangles(new int[][]{{2, 3}, {3, 7}, {4, 3}, {3, 7}}));
    }
}
